﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using WeiXin.Lib.Core.Consts;
using WeiXin.Lib.Core.Helper;
using WeiXin.Lib.Core.Models;

namespace KL.UFrame.Api.Controllers
{
    public abstract class K9ControllerBase : Controller
    {
        protected ViewResult NotFound()
        {
            return View("NotFound");
        }

        protected async Task<Dictionary<string, string>> GetWechatJsApiSignatureAsync(string url = null)
        {
            var ticket = JsApiTicket.GetTicketFromWcf();
            var dic= await WeiXinHelper.GetJsApiSignatureAsync(url ?? Request.Url.ToString(),ticket);
            dic.Add("appId",WeiXinConst.AppId);
            return dic;
        }

    }
}